<%-- 
    Document   : editPartner
    Created on : Jul 13, 2013, 7:18:11 PM
    Author     : jitendra
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@include file="../common/script.jsp" %>

<script type="text/javaScript">           
    var rules=new Array();
    rules[0]='centerId|required|please select Center Name'; 
    rules[1]='partnerDetailId|required|please Select Partner'; 
    rules[2]='partnerTypeId|required|please Select Partner Type';
    rules[3]='priority|required|please Select Priority';  
    
    
    function editPartnerDetail(partnerID){
        var partnerDetailId=$("#partnerDetailId").val();
        location.href="../partner/editPartnerDetail.htm?partnerDetailId="+partnerDetailId+"&partnerID=${partner.partnerID}";
    
    }
        
</script>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="../common/title.jsp" %>
    </head>
    <body onLoad="yav.init('form1',rules,'inline');">
        <%@include file="../common/header.jsp" %>
        <%@include file="../common/menu.jsp" %>
        <div class="in_02" >
            <%@include file="../common/message.jsp" %>
            <form:form id="form1" modelAttribute="partner" action="editPartner.htm" method="POST">
                <fieldset>
                    <legend>Edit Partner</legend>
                    <table class="formTable">
                        <tr>
                            <td>Clinic:<br/><form:select path="HealthSpringCenter.centerId" id="centerId" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:options itemLabel="centerName" itemValue="centerId" items="${HealthSpringCenter}"></form:options>
                                </form:select><br/><span id="errorsDiv_centerId"></span></td>
                            <td>Partner:<br/>
                                <form:select path="PartnerDetail.partnerDetailId" id="partnerDetailId" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:options itemLabel="name" itemValue="partnerDetailId" items="${PartnerDetail}"></form:options>
                                </form:select>

                                <sec:authorize ifAnyGranted="ROLE_BF_PARTNER_DETAIL_EDIT">
                                    <%--../partner/editPartnerDetail.htm?partnerDetailId=${partner.partnerDetail.partnerDetailId}&partnerID=${partner.partnerID}--%>
                                    <span style="font-size: 15px; font-weight: bold;"><a href="javascript:editPartnerDetail(${partner.partnerID})"/>Edit Partner Detail</a></span>
                                </sec:authorize>
                                <br/>
                                <span id="errorsDiv_partnerDetailId"></span>

                            </td>
                        </tr>
                        <tr>
                            <td>Partner Type:<br/><form:select path="PartnerType.partnerTypeId" id="partnerTypeId" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:options itemLabel="partnerType" itemValue="partnerTypeId" items="${PartnerType}"></form:options>
                                </form:select><br/><span id="errorsDiv_partnerTypeId"></span></td>
                            <td>Prioriy:<br/><form:select path="priority" id="priority" cssClass="userInputLarge">
                                    <form:option value="" label="-"></form:option>
                                    <form:option value="1" label="1"></form:option>
                                    <form:option value="2" label="2"></form:option>
                                    <form:option value="3" label="3"></form:option>
                                </form:select><br/><span id="errorsDiv_priority"></span></td>

                        </tr>

                        <tr>
                            <td><form:hidden path="partnerID" />
                                <input type="button" name="Cancel" value="Cancel"  onclick="location.href='../partner/listPartner.htm'"></td>                       
                            <td><input type="submit" name="btnSubmit" class="userInputFormSubmit" value="Update" onclick="return yav.performCheck('form1', rules, 'inline');"/></td>
                        </tr>
                    </table>

                    <spring:hasBindErrors name="partner">
                        <div class="error">
                            <form:errors path="*"/>
                        </div>
                    </spring:hasBindErrors>
                </fieldset>
            </form:form>
        </div>
    </body>
</html>
